package com.yunlongn.async.config;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.context.ApplicationListener;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;


/**
 * @author yunlong.li
 */
@Component
public class RetrySchedulerConfig implements BeanFactoryAware {

    private static StringRedisTemplate stringRedisTemplate;


    @Override
    public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
        stringRedisTemplate = beanFactory.getBean(StringRedisTemplate.class);
    }

    public static StringRedisTemplate getStringRedisTemplate() {
        return stringRedisTemplate;
    }
}
